import type { GeneratedEtsLibFile } from "../../types/generated";

export const FILE: GeneratedEtsLibFile = {
  path: 'ets/api/@ohos.file.fs.d.ts',
  content: "/*\n * Copyright (c) 2022-2025 Huawei Device Co., Ltd.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @file\n * @kit CoreFileKit\n */\nimport { AsyncCallback } from './@ohos.base';\nimport stream from './@ohos.util.stream';\nexport default fileIo;\n/**\n * FileIO\n *\n * @namespace fileIo\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * FileIO\n *\n * @namespace fileIo\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * FileIO\n *\n * @namespace fileIo\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * FileIO\n *\n * @namespace fileIo\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare namespace fileIo {\n    export { access };\n    export { accessSync };\n    export { close };\n    export { closeSync };\n    export { copy };\n    export { copyDir };\n    export { copyDirSync };\n    export { copyFile };\n    export { copyFileSync };\n    export { createRandomAccessFile };\n    export { createRandomAccessFileSync };\n    export { createStream };\n    export { createStreamSync };\n    export { createReadStream };\n    export { createWriteStream };\n    export { createWatcher };\n    export { dup };\n    export { fdatasync };\n    export { fdatasyncSync };\n    export { fdopenStream };\n    export { fdopenStreamSync };\n    export { fsync };\n    export { fsyncSync };\n    export { getxattr };\n    export { getxattrSync };\n    export { listFile };\n    export { listFileSync };\n    export { lseek };\n    export { lstat };\n    export { lstatSync };\n    export { mkdir };\n    export { mkdirSync };\n    export { mkdtemp };\n    export { mkdtempSync };\n    export { moveDir };\n    export { moveDirSync };\n    export { moveFile };\n    export { moveFileSync };\n    export { open };\n    export { openSync };\n    export { read };\n    export { readSync };\n    export { readLines };\n    export { readLinesSync };\n    export { readText };\n    export { readTextSync };\n    export { rename };\n    export { renameSync };\n    export { rmdir };\n    export { rmdirSync };\n    export { setxattr };\n    export { setxattrSync };\n    export { stat };\n    export { statSync };\n    export { symlink };\n    export { symlinkSync };\n    export { truncate };\n    export { truncateSync };\n    export { unlink };\n    export { unlinkSync };\n    export { utimes };\n    export { write };\n    export { writeSync };\n    export { AccessModeType };\n    export { AccessFlagType };\n    export { File };\n    export { OpenMode };\n    export { RandomAccessFile };\n    export { ReaderIterator };\n    export { Stat };\n    export { Stream };\n    export { ReadStream };\n    export { WriteStream };\n    export { AtomicFile };\n    export { Watcher };\n    export { WhenceType };\n    export { TaskSignal };\n    export { connectDfs };\n    export { disconnectDfs };\n    export type { Progress };\n    export type { CopyOptions };\n    export type { ProgressListener };\n    export type { DfsListeners };\n    /**\n     * Mode Indicates the open flags.\n     *\n     * @namespace OpenMode\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Mode Indicates the open flags.\n     *\n     * @namespace OpenMode\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * Mode Indicates the open flags.\n     *\n     * @namespace OpenMode\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    namespace OpenMode {\n        /**\n         * Read only Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * Read only Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Read only Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        const READ_ONLY = 0o0;\n        /**\n         * Write only Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * Write only Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Write only Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        const WRITE_ONLY = 0o1;\n        /**\n         * Write and Read Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * Write and Read Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Write and Read Permission.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        const READ_WRITE = 0o2;\n        /**\n         * If not exist, create file.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * If not exist, create file.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * If not exist, create file.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        const CREATE = 0o100;\n        /**\n         * File truncate len 0.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * File truncate len 0.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * File truncate len 0.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        const TRUNC = 0o1000;\n        /**\n         * File append write.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * File append write.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * File append write.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @atomicservice\n         * @since 11\n         */\n        const APPEND = 0o2000;\n        /**\n         * File open in nonblocking mode.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * File open in nonblocking mode.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        const NONBLOCK = 0o4000;\n        /**\n         * File is Dir.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * File is Dir.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        const DIR = 0o200000;\n        /**\n         * File is not symbolic link.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * File is not symbolic link.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        const NOFOLLOW = 0o400000;\n        /**\n         * SYNC IO.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @since 9\n         */\n        /**\n         * SYNC IO.\n         *\n         * @constant\n         * @syscap SystemCapability.FileManagement.File.FileIO\n         * @crossplatform\n         * @since 10\n         */\n        const SYNC = 0o4010000;\n    }\n}\n/**\n * Access file.\n *\n * @param { string } path - path.\n * @returns { Promise<boolean> } return Promise\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Access file.\n *\n * @param { string } path - path.\n * @returns { Promise<boolean> } Returns the file is accessible or not in promise mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Access file.\n *\n * @param { string } path - path.\n * @returns { Promise<boolean> } Returns the file is accessible or not in promise mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Checks whether the file or directory exists or has the operation permission.\n * This API uses a promise to return the result.\n * If the read, write, or read and write permission verification fails,\n * the error code 13900012 (Permission denied) will be thrown.\n *\n * @param { string } path - Application sandbox path of the file to check.\n * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - Permission on the file to verify.\n * <br>If this parameter is left blank, the system checks whether the file exists.\n * @returns { Promise<boolean> } Promise used to return a Boolean value.\n * <br>Returns true if the file exists; returns false otherwise.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function access(path: string, mode?: AccessModeType): Promise<boolean>;\n/**\n * Access file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<boolean> } callback - The callback is used to return the file is accessible or not.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Access file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<boolean> } callback - The callback is used to return the file is accessible or not.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Checks whether a file or directory exists. This API uses an asynchronous callback to return the result.\n *\n * @param { string } path - Application sandbox path of the file to check.\n * @param { AsyncCallback<boolean> } callback - Callback invoked to return the result.\n * <br>The value true means the file exists; the value false means the opposite.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function access(path: string, callback: AsyncCallback<boolean>): void;\n/**\n * Checks whether the file or directory is stored locally or has the operation permission.\n * This API uses a promise to return the result.If the read, write, or read and write permission verification fails,\n * the error code 13900012 (Permission denied) will be thrown.\n *\n * @param { string } path - Application sandbox path of the file to check.\n * @param { AccessModeType } mode - Permission on the file to verify.\n * @param { AccessFlagType } flag - Location of the file to verify.\n * @returns { Promise<boolean> } Promise used to return a Boolean value.\n * <br>The value true means the file is a local file and has the related permission.\n * <br>The value false means the file does not exist or is on the cloud or a distributed device.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function access(path: string, mode: AccessModeType, flag: AccessFlagType): Promise<boolean>;\n/**\n * Access file with sync interface.\n *\n * @param { string } path - path.\n * @returns { boolean } Returns the file is accessible or not.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Access file with sync interface.\n *\n * @param { string } path - path.\n * @returns { boolean } Returns the file is accessible or not.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Access file with sync interface.\n *\n * @param { string } path - path.\n * @returns { boolean } Returns the file is accessible or not.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n *\n * Checks whether a file or directory exists or has the operation permission.\n * This API returns the result synchronously.If the read, write, or read and write permission verification fails,\n * the error code 13900012 (Permission denied) will be thrown.\n *\n * @param { string } path - Application sandbox path of the file to check.\n * @param { AccessModeType } [mode = fs.AccessModeType.EXIST] - Permission on the file to verify.\n * <br>If this parameter is left blank, the system checks whether the file exists.\n * @returns { boolean } Returns true if the file exists; returns false otherwise.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function accessSync(path: string, mode?: AccessModeType): boolean;\n/**\n * Checks whether a file or directory is stored locally or has the operation permission. This API returns the result synchronously.\n * If the read, write, or read and write permission verification fails,\n * the error code 13900012 (Permission denied) will be thrown.\n *\n * @param { string } path - Application sandbox path of the file to check.\n * @param { AccessModeType } mode - Permission on the file to verify.\n * @param { AccessFlagType } flag - Location of the file to verify.\n * @returns { boolean } Returns true if the file is a local file and has the related permission;\n * <br>returns false if the file does not exist or is on the cloud or a distributed device.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function accessSync(path: string, mode: AccessModeType, flag: AccessFlagType): boolean;\n/**\n * Close file or fd.\n *\n * @param { number | File } file - file object or fd.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Close file or fd.\n *\n * @param { number | File } file - file object or fd.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Closes a file or directory. This API uses a promise to return the result.\n *\n * @param { number | File } file - File object or FD of the file to close.\n * <br>Once closed, the File object or FD cannot be used for read or write operations.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function close(file: number | File): Promise<void>;\n/**\n * Close file or fd.\n *\n * @param { number | File } file - file object or fd.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Close file or fd.\n *\n * @param { number | File } file - file object or fd.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Closes a file or directory. This API uses an asynchronous callback to return the result.\n *\n * @param { number | File } file - File object or FD of the file to close.\n * <br>Once closed, the File object or FD cannot be used for read or write operations.\n * @param { AsyncCallback<void> } callback - Callback invoked immediately after the file is closed.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function close(file: number | File, callback: AsyncCallback<void>): void;\n/**\n * Close file or fd with sync interface.\n *\n * @param { number | File } file - file object or fd.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Close file or fd with sync interface.\n *\n * @param { number | File } file - file object or fd.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Closes a file or directory. This API returns the result synchronously.\n *\n * @param { number | File } file - File object or FD of the file to close.\n * <br>Once closed, the File object or FD cannot be used for read or write operations.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function closeSync(file: number | File): void;\n/**\n * Copy file or directory.\n *\n * @param { string } srcUri - src uri.\n * @param { string } destUri - dest uri.\n * @param { CopyOptions } [options] - options.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied by the file system\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900021 - File table overflow\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\n/**\n * Copies a file or directory. This API uses a promise to return the result.\n * File copy across devices is supported. This API forcibly overwrites the file or directory.\n * The input parameter can be the URI of the file or directory. A maximum of 10 cross-device copy tasks are allowed at the same time,\n * and the number of files to be copied at a time cannot exceed 500.\n *\n * @param { string } srcUri - URI of the file or directory to copy.\n * @param { string } destUri - URI of the destination file or directory.\n * @param { CopyOptions } [options] - Callback invoked to provide the copy progress.\n * <br>If this parameter is not set, the callback will not be invoked.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied by the file system\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900021 - File table overflow\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function copy(srcUri: string, destUri: string, options?: CopyOptions): Promise<void>;\n/**\n * Copies a file or directory. This API uses an asynchronous callback to return the result.\n * File copy across devices is supported. This API forcibly overwrites the file or directory. The file or directory URI is supported.\n * A maximum of 10 cross-device copy tasks are allowed at the same time,\n * and the number of files to be copied at a time cannot exceed 500.\n *\n * @param { string } srcUri - URI of the file or directory to copy.\n * @param { string } destUri - URI of the destination file or directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied by the file system\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900021 - File table overflow\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare function copy(srcUri: string, destUri: string, callback: AsyncCallback<void>): void;\n/**\n * Copies a file or directory. This API uses an asynchronous callback to return the result.\n * File copy across devices is supported. This API forcibly overwrites the file or directory. The file or directory URI is supported.\n * A maximum of 10 cross-device copy tasks are allowed at the same time,\n * and the number of files to be copied at a time cannot exceed 500.\n *\n * @param { string } srcUri - URI of the file or directory to copy.\n * @param { string } destUri - URI of the destination file or directory.\n * @param { CopyOptions } options - Callback used to return the copy progress.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied by the file system\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900021 - File table overflow\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare function copy(srcUri: string, destUri: string, options: CopyOptions, callback: AsyncCallback<void>): void;\n/**\n * Copy directory.\n *\n * @param { string } src - source path.\n * @param { string } dest - destination path.\n * @param { number } [mode = 0] - mode.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\n/**\n * Copies the source directory to the destination directory. This API uses a promise to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination folder.\n * @param { number } [mode = 0] - Copy mode. The default value is 0.\n * <br>0: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory will be moved\n * <br>to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>1: Forcibly overwrite the files with the same name in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function copyDir(src: string, dest: string, mode?: number): Promise<void>;\n/**\n * Copies the source directory to the destination directory.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function copyDir(src: string, dest: string, callback: AsyncCallback<void>): void;\n/**\n * Copies the source directory to the destination directory.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900015 - File exists\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function copyDir(src: string, dest: string, callback: AsyncCallback<void, Array<ConflictFiles>>): void;\n/**\n * Copies the source directory to the destination directory. You can set the copy mode.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { number } mode - Copy mode. The default value is 0.\n * <br>0: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory will be moved\n * <br>to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>1: Forcibly overwrite the files with the same name in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback<void>): void;\n/**\n * Copies the source directory to the destination directory. You can set the copy mode.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { number } mode - Copy mode. The default value is 0.\n * <br>0: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory will be moved\n * <br>to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>1: Forcibly overwrite the files with the same name in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900015 - File exists\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function copyDir(src: string, dest: string, mode: number, callback: AsyncCallback<void, Array<ConflictFiles>>): void;\n/**\n * Copy directory with sync interface.\n *\n * @param { string } src - source path.\n * @param { string } dest - destination path.\n * @param { number } [mode = 0] - mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\n/**\n * Copies the source directory to the destination directory. This API returns the result synchronously.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the source directory.\n * @param { number } [mode = 0] - Copy mode. The default value is 0.\n * <br>0: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory will be moved\n * <br>to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>1: Forcibly overwrite the files with the same name in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function copyDirSync(src: string, dest: string, mode?: number): void;\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Copies a file. This API uses a promise to return the result.\n *\n * @param { string | number } src - Path or FD of the file to copy.\n * @param { string | number } dest - Destination path of the file or FD of the file created.\n * @param { number } [mode = 0] - Whether to overwrite the file with the same name in the destination directory.\n * <br>The default value is 0, which is the only value supported.\n * <br>0: overwrite the file with the same name and truncate the part that is not overwritten.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function copyFile(src: string | number, dest: string | number, mode?: number): Promise<void>;\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Copies a file. This API overwrites the file with the same name in the destination directory and truncates the part that is not overwritten.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string | number } src - Path or FD of the file to copy.\n * @param { string | number } dest - Destination path of the file or FD of the file created.\n * @param { AsyncCallback<void> } callback - Callback invoked immediately after the file is copied.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function copyFile(src: string | number, dest: string | number, callback: AsyncCallback<void>): void;\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Copy file.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Copies a file. This API overwrites the file with the same name in the destination directory\n * and truncates the part that is not overwritten. This API uses an asynchronous callback to return the result.\n *\n * @param { string | number } src - Path or FD of the file to copy.\n * @param { string | number } dest - Destination path of the file or FD of the file created.\n * @param { number } [mode = 0] - Whether to overwrite the file with the same name in the destination directory.\n * <br>The default value is 0, which is the only value supported.\n * <br>0: overwrite the file with the same name and truncate the part that is not overwritten.\n * @param { AsyncCallback<void> } callback - Callback invoked immediately after the file is copied.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function copyFile(src: string | number, dest: string | number, mode: number, callback: AsyncCallback<void>): void;\n/**\n * Copy file with sync interface.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Copy file with sync interface.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Copy file with sync interface.\n *\n * @param { string | number } src - src.\n * @param { string | number } dest - dest.\n * @param { number } [mode = 0] - mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Copies a file. This API returns the result synchronously.\n *\n * @param { string | number } src - Path or FD of the file to copy.\n * @param { string | number } dest - Destination path of the file or FD of the file created.\n * @param { number } [mode = 0] - Whether to overwrite the file with the same name in the destination directory.\n * <br>The default value is 0, which is the only value supported.\n * <br>0: overwrite the file with the same name and truncate the part that is not overwritten.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function copyFileSync(src: string | number, dest: string | number, mode?: number): void;\n/**\n * Create class Stream.\n *\n * @param { string } path - path.\n * @param { string } mode - mode.\n * @returns { Promise<Stream> } return Promise\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Creates a stream based on a file path. This API uses a promise to return the result.\n * To close the stream, use close() of Stream.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file.\n * <br>If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Promise<Stream> } Promise used to return the stream opened.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\n/**\n * Creates a stream based on a file path. This API uses a promise to return the result.\n * To close the stream, use close() of Stream.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file.\n * <br>If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Promise<Stream> } Promise used to return the stream opened.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare function createStream(path: string, mode: string): Promise<Stream>;\n/**\n * Creates a stream based on a file path. This API uses an asynchronous callback to return the result.\n * To close the stream, use close() of Stream.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file.\n * <br>If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @param { AsyncCallback<Stream> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Creates a stream based on a file path. This API uses an asynchronous callback to return the result.\n * To close the stream, use close() of Stream.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file.\n * <br>If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @param { AsyncCallback<Stream> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare function createStream(path: string, mode: string, callback: AsyncCallback<Stream>): void;\n/**\n * Create class Stream with sync interface.\n *\n * @param { string } path - path.\n * @param { string } mode - mode.\n * @returns { Stream } createStream\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Creates a stream based on a file path. This API returns the result synchronously.\n * To close the stream, use close() of Stream.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file.\n * <br>If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Stream } Stream opened.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\n/**\n * Creates a stream based on a file path. This API returns the result synchronously.\n * To close the stream, use close() of Stream.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file.\n * <br>If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Stream } Stream opened.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare function createStreamSync(path: string, mode: string): Stream;\n/**\n * Create class RandomAccessFile.\n *\n * @param { string | File } file - file path, object.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { Promise<RandomAccessFile> } Returns the RandomAccessFile object which has been created in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\n/**\n * Creates a RandomAccessFile instance based on a file path or file object.\n * This API uses a promise to return the result.\n *\n * @param { string | File } file - Application sandbox path of the file or an opened file object.\n * @param { number } [mode = OpenMode.READ_ONLY] - Mode for creating the RandomAccessFile instance.\n * <br>This parameter is valid only when the application sandbox path of the file is passed in.\n * <br>One of the following options must be specified:\n * <br>OpenMode.READ_ONLY(0o0): Create the file in read-only mode. This is the default value.\n * <br>OpenMode.WRITE_ONLY(0o1): Create the file in write-only mode.\n * <br>OpenMode.READ_WRITE(0o2): Create the file in read/write mode.\n * <br>You can also specify the following options, separated by a bitwise OR operator (|). By default,\n * <br>no additional options are given.\n * <br>OpenMode.CREATE(0o100): If the file does not exist, create it.\n * <br>OpenMode.TRUNC(0o1000): If the RandomAccessFile object already exists and is created in write mode,\n * <br>truncate the file length to 0.\n * <br>OpenMode.APPEND(0o2000): Create the file in append mode. New data will be added to the end\n * <br>of the RandomAccessFile object.\n * <br>OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n * <br>or character special file, perform non-blocking operations on the created file and in subsequent I/Os.\n * <br>OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n * <br>OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n * <br>OpenMode.SYNC(0o4010000): Create a RandomAccessFile instance in synchronous I/O mode.\n * @param { RandomAccessFileOptions } [options] - Defines the options used in createRandomAccessFile().\n * @returns { Promise<RandomAccessFile> } Promise used to return the RandomAccessFile instance created.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function createRandomAccessFile(file: string | File, mode?: number, options?: RandomAccessFileOptions): Promise<RandomAccessFile>;\n/**\n * Creates a RandomAccessFile object in read-only mode based on a file path or file object.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string | File } file - Application sandbox path of the file or an opened file object.\n * @param { AsyncCallback<RandomAccessFile> } callback - Callback used to return the RandomAccessFile instance created.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function createRandomAccessFile(file: string | File, callback: AsyncCallback<RandomAccessFile>): void;\n/**\n * Creates a RandomAccessFile instance based on a file path or file object.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string | File } file - Application sandbox path of the file or an opened file object.\n * @param { number } [mode = OpenMode.READ_ONLY] - Mode for creating the RandomAccessFile instance.\n * <br>This parameter is valid only when the application sandbox path of the file is passed in.\n * <br>One of the following options must be specified:\n * <br>OpenMode.READ_ONLY(0o0): Create the file in read-only mode. This is the default value.\n * <br>OpenMode.WRITE_ONLY(0o1): Create the file in write-only mode.\n * <br>OpenMode.READ_WRITE(0o2): Create the file in read/write mode.\n * <br>You can also specify the following options, separated by a bitwise OR operator (|). By default,\n * <br>no additional options are given.\n * <br>OpenMode.CREATE(0o100): If the file does not exist, create it.\n * <br>OpenMode.TRUNC(0o1000): If the RandomAccessFile object already exists and is created in write mode,\n * <br>truncate the file length to 0.\n * <br>OpenMode.APPEND(0o2000): Create the file in append mode. New data will be added to the end\n * <br>of the RandomAccessFile object.\n * <br>OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n * <br>or character special file, perform non-blocking operations on the created file and in subsequent I/Os.\n * <br>OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n * <br>OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n * <br>OpenMode.SYNC(0o4010000): Create a RandomAccessFile instance in synchronous I/O mode.\n * @param { AsyncCallback<RandomAccessFile> } callback - Callback used to return the RandomAccessFile instance created.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function createRandomAccessFile(file: string | File, mode: number, callback: AsyncCallback<RandomAccessFile>): void;\n/**\n * Create class RandomAccessFile with sync interface.\n *\n * @param { string | File } file - file path, object.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { RandomAccessFile } Returns the RandomAccessFile object which has been created.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\n/**\n * Creates a RandomAccessFile instance based on a file path or file object.\n *\n * @param { string | File } file - Application sandbox path of the file or an opened file object.\n * @param { number } [mode = OpenMode.READ_ONLY] - Mode for creating the RandomAccessFile instance.\n * <br>This parameter is valid only when the application sandbox path of the file is passed in.\n * <br>One of the following options must be specified:\n * <br>OpenMode.READ_ONLY(0o0): Create the file in read-only mode. This is the default value.\n * <br>OpenMode.WRITE_ONLY(0o1): Create the file in write-only mode.\n * <br>OpenMode.READ_WRITE(0o2): Create the file in read/write mode.\n * <br>You can also specify the following options, separated by a bitwise OR operator (|). By default,\n * <br>no additional options are given.\n * <br>OpenMode.CREATE(0o100): If the file does not exist, create it.\n * <br>OpenMode.TRUNC(0o1000): If the RandomAccessFile object already exists and is created in write mode,\n * <br>truncate the file length to 0.\n * <br>OpenMode.APPEND(0o2000): Create the file in append mode. New data will be added to the end\n * <br>of the RandomAccessFile object.\n * <br>OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n * <br>or character special file, perform non-blocking operations on the created file and in subsequent I/Os.\n * <br>OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n * <br>OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n * <br>OpenMode.SYNC(0o4010000): Create a RandomAccessFile instance in synchronous I/O mode.\n * @param { RandomAccessFileOptions } [options] - Defines the options used in createRandomAccessFile().\n * @returns { RandomAccessFile } RandomAccessFile instance created.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function createRandomAccessFileSync(file: string | File, mode?: number, options?: RandomAccessFileOptions): RandomAccessFile;\n/**\n * Creates a readable stream. This API returns the result synchronously.\n *\n * @param { string } path - Path of the file.\n * @param { ReadStreamOptions } [options] - Defines the options used in createReadStream().\n * @returns { ReadStream } ReadStream instance obtained.\n * @throws { BusinessError } 401 - Parameter error\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\n/**\n * Creates a readable stream. This API returns the result synchronously.\n *\n * @param { string } path - Path of the file.\n * @param { ReadStreamOptions } [options] - The options are as follows:\n * <br>start (number): start position of the data to read in the file. This parameter is optional.\n * <br>By default, data is read from the current position.\n * <br>end (number): end position of the data to read in the file. This parameter is optional.\n * <br>The default value is the end of the file.\n * @returns { ReadStream } ReadStream instance obtained.\n * @throws { BusinessError } 401 - Parameter error\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 20\n */\ndeclare function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;\n/**\n * Creates a writeable stream. This API returns the result synchronously.\n *\n * @param { string } path - Path of the file.\n * @param { WriteStreamOptions } [options] - Defines the options used in createWriteStream().\n * @returns { WriteStream } ReadStream instance obtained.\n * @throws { BusinessError } 401 - Parameter error\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\n/**\n * Creates a writeable stream. This API returns the result synchronously.\n *\n * @param { string } path - Path of the file.\n * @param { WriteStreamOptions } [options] - The options are as follows:\n * <br>start (number): start position to write the data in the file. This parameter is optional.\n * <br>By default, data is written from the current position.\n * <br>mode (number): mode for creating the writeable stream. This parameter is optional.\n * <br>The default value is the write-only mode.\n * @returns { WriteStream } ReadStream instance obtained.\n * @throws { BusinessError } 401 - Parameter error\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 20\n */\ndeclare function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;\n/**\n * Creates a Watcher object to listen for file or directory changes.\n *\n * @param { string } path - Application sandbox path of the file or directory to observe.\n * @param { number } events - Events to observe. Multiple events can be separated by a bitwise OR operator (|).\n * @param { WatchEventListener } listener - Callback invoked when an observed event occurs.\n * <br>The callback will be invoked each time an observed event occurs.\n * @returns { Watcher } Watcher object created.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900021 - File table overflow\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher;\n/**\n * Opens a File object based on an FD.\n *\n * @param { number } fd - FD of the file.\n * @returns { File } File object opened.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function dup(fd: number): File;\n/**\n * Synchronize file metadata.\n *\n * @param { number } fd - fd.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Synchronizes the data of a file. This API uses a promise to return the result.\n *\n * @param { number } fd - FD of the file.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function fdatasync(fd: number): Promise<void>;\n/**\n * Synchronize file metadata.\n *\n * @param { number } fd - fd.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Synchronizes the data (excluding the metadata) of a file.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function fdatasync(fd: number, callback: AsyncCallback<void>): void;\n/**\n * Synchronize file metadata with sync interface.\n *\n * @param { number } fd - fd.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Synchronizes the data of a file. This API returns the result synchronously.\n *\n * @param { number } fd - FD of the file.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function fdatasyncSync(fd: number): void;\n/**\n * Opens a stream based on an FD. This API uses a promise to return the result. To close the stream,\n * use close() of Stream.\n *\n * @param { number } fd - FD of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file. If the file does not exist,\n * <br>create a file. If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Promise<Stream> } Returns the Stream object in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Opens a stream based on an FD. This API uses a promise to return the result. To close the stream,\n * use close() of Stream.\n *\n * @param { number } fd - FD of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file. If the file does not exist,\n * <br>create a file. If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Promise<Stream> } Returns the Stream object in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare function fdopenStream(fd: number, mode: string): Promise<Stream>;\n/**\n * Opens a stream based on an FD. This API uses an asynchronous callback to return the result.\n * To close the stream, use close() of Stream.\n *\n * @param { number } fd - FD of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file. If the file does not exist,\n * <br>create a file. If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @param { AsyncCallback<Stream> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Opens a stream based on an FD. This API uses an asynchronous callback to return the result.\n * To close the stream, use close() of Stream.\n *\n * @param { number } fd - FD of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file. If the file does not exist,\n * <br>create a file. If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @param { AsyncCallback<Stream> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare function fdopenStream(fd: number, mode: string, callback: AsyncCallback<Stream>): void;\n/**\n * Opens a stream based on an FD. This API returns the result synchronously. To close the stream, use close() of Stream.\n *\n * @param { number } fd - FD of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file. If the file does not exist,\n * <br>create a file. If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Stream } Returns the Stream object.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Opens a stream based on an FD. This API returns the result synchronously. To close the stream, use close() of Stream.\n *\n * @param { number } fd - FD of the file.\n * @param { string } mode - r: Open a file for reading. The file must exist.\n * <br>r+: Open a file for both reading and writing. The file must exist.\n * <br>w: Open a file for writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>w+: Open a file for both reading and writing. If the file exists, clear its content. If the file does not exist, create a file.\n * <br>a: Open a file in append mode for writing at the end of the file. If the file does not exist, create a file.\n * <br>If the file exists, write data to the end of the file (the original content of the file is reserved).\n * <br>a+: Open a file in append mode for reading or updating at the end of the file. If the file does not exist,\n * <br>create a file. If the file exists, write data to the end of the file (the original content of the file is reserved).\n * @returns { Stream } Returns the Stream object.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare function fdopenStreamSync(fd: number, mode: string): Stream;\n/**\n * Synchronize file.\n *\n * @param { number } fd - fd.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Synchronizes the cached data of a file to storage. This API uses a promise to return the result.\n *\n * @param { number } fd - FD of the file.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function fsync(fd: number): Promise<void>;\n/**\n * Synchronize file.\n *\n * @param { number } fd - fd.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Synchronizes the cached data of a file to storage. This API uses an asynchronous callback to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function fsync(fd: number, callback: AsyncCallback<void>): void;\n/**\n * Synchronize file with sync interface.\n *\n * @param { number } fd - fd.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Synchronizes the cached data of a file to storage. This API returns the result synchronously.\n *\n * @param { number } fd - FD of the file.\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function fsyncSync(fd: number): void;\n/**\n * List file.\n *\n * @param { string } path - path.\n * @param { object } [options] - options.\n * @returns { Promise<string[]> } Returns an Array containing the name of files or directories that meet the filter criteria in promise mode.\n *      If present, Include the subdirectory structure.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * List file.\n *\n * @param { string } path - path.\n * @param { object } [options] - options.\n * @returns { Promise<string[]> } Returns an Array containing the name of files or directories that meet the filter criteria.\n *      If present, Include the subdirectory structure.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Lists all file names in a directory. This API supports recursive listing of all file names and file filtering.\n * The returned result starts with a slash (/) and contains the subdirectory. This API uses a promise to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { ListFileOptions } [options] - Options for filtering files. The files are not filtered by default.\n * @returns { Promise<string[]> } Promise used to return the file names listed.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function listFile(path: string, options?: ListFileOptions): Promise<string[]>;\n/**\n * List file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories\n *      that meet the filter criteria in promise mode. If present, Include the subdirectory structure.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * List file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories\n *      that meet the filter criteria in promise mode. If present, Include the subdirectory structure.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Lists all file names in a directory. This API uses a promise to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { AsyncCallback<string[]> } callback - Options for filtering files. The files are not filtered by default\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function listFile(path: string, callback: AsyncCallback<string[]>): void;\n/**\n * List file.\n *\n * @param { string } path - path.\n * @param { object } [options] - options.\n * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories\n *      that meet the filter criteria in promise mode. If present, Include the subdirectory structure.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * List file.\n *\n * @param { string } path - path.\n * @param { object } [options] - options.\n * @param { AsyncCallback<string[]> } callback - The callback is used to return an Array containing the name of files or directories\n *      that meet the filter criteria in promise mode. If present, Include the subdirectory structure.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Lists all file names in a directory. This API supports recursive listing of all file names and file filtering.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { ListFileOptions } [options] - Options for filtering files. The files are not filtered by default.\n * @param { AsyncCallback<string[]> } callback - Callback used to return the file names listed.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function listFile(path: string, options: ListFileOptions, callback: AsyncCallback<string[]>): void;\n/**\n * List file with sync interface.\n *\n * @param { string } path - path.\n * @param { object } [options] - options.\n * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * List file with sync interface.\n *\n * @param { string } path - path.\n * @param { object } [options] - options.\n * @returns { string[] } Returns an Array containing the name of files or directories that meet the filter criteria.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Lists all file names in a directory. This API returns the result synchronously.\n * This API supports recursive listing of all file names and file filtering.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { ListFileOptions } [options] - Options for filtering files. The files are not filtered by default.\n * @returns { string[] } List of the file names obtained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function listFileSync(path: string, options?: ListFileOptions): string[];\n/**\n *  Reposition file offset.\n *\n * @param { number } fd - file descriptor.\n * @param { number } offset - file offset.\n * @param { WhenceType } [whence = WhenceType.SEEK_SET] - directive whence.\n * @returns { number } Returns the file offset relative to starting position of file.\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900026 - Illegal seek\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\n/**\n * Adjusts the position of the file offset pointer.\n *\n * @param { number } fd - FD of the file.\n * @param { number } offset - Number of bytes to move the offset.\n * @param { WhenceType } [whence = WhenceType.SEEK_SET] - Where to start the offset.\n * <br>If this parameter is not specified, the file start position is used by default.\n * @returns { number } Returns the file offset relative to starting position of file.\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900026 - Illegal seek\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 12\n */\ndeclare function lseek(fd: number, offset: number, whence?: WhenceType): number;\n/**\n * Obtains information about a symbolic link that is used to refer to a file or directory.\n * This API uses a promise to return the result.\n *\n * @param { string } path - Application sandbox path of the file.\n * @returns { Promise<Stat> } Promise used to return the symbolic link information obtained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\ndeclare function lstat(path: string): Promise<Stat>;\n/**\n * Obtains information about a symbolic link that is used to refer to a file or directory.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { AsyncCallback<Stat> } callback - Callback used to return the symbolic link information obtained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\ndeclare function lstat(path: string, callback: AsyncCallback<Stat>): void;\n/**\n * Obtains information about a symbolic link that is used to refer to a file or directory.\n * This API returns the result synchronously.\n *\n * @param { string } path - Application sandbox path of the file.\n * @returns { Stat } File information obtained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\ndeclare function lstatSync(path: string): Stat;\n/**\n * Make dir.\n *\n * @param { string } path - path.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Make dir.\n *\n * @param { string } path - path.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Creates a directory. This API uses a promise to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function mkdir(path: string): Promise<void>;\n/**\n * Creates a directory. This API uses a promise to return the result. The value true means to create a directory recursively.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { boolean } recursion - Whether to create a directory recursively.\n * <br>The value true means to create a directory recursively. The value false means to create a single-level directory.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\ndeclare function mkdir(path: string, recursion: boolean): Promise<void>;\n/**\n * Make dir.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Make dir.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Creates a directory. This API uses an asynchronous callback to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function mkdir(path: string, callback: AsyncCallback<void>): void;\n/**\n * Creates a directory. This API uses an asynchronous callback to return the result.\n * The value true means to create a directory recursively.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { boolean } recursion - Whether to create a directory recursively.\n * <br>The value true means to create a directory recursively. The value false means to create a single-level directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\ndeclare function mkdir(path: string, recursion: boolean, callback: AsyncCallback<void>): void;\n/**\n * Make dir with sync interface.\n *\n * @param { string } path - path.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Make dir with sync interface.\n *\n * @param { string } path - path.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Creates a directory. This API returns the result synchronously.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function mkdirSync(path: string): void;\n/**\n * Creates a directory. This API returns the result synchronously. The value true means to create a directory recursively.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { boolean } recursion - Whether to create a directory recursively.\n * <br>The value true means to create a directory recursively. The value false means to create a single-level directory.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\ndeclare function mkdirSync(path: string, recursion: boolean): void;\n/**\n * Make temp dir.\n *\n * @param { string } prefix - dir prefix.\n * @returns { Promise<string> } Returns the path to the new directory in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Creates a temporary directory. This API uses a promise to return the result.\n *\n * @param { string } prefix - String to be replaced with six randomly generated characters to create a unique temporary directory.\n * @returns { Promise<string> } Promise used to return the directory created.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function mkdtemp(prefix: string): Promise<string>;\n/**\n * Make temp dir.\n *\n * @param { string } prefix - dir prefix.\n * @param { AsyncCallback<string> } callback - The callback is used to return the path to the new directory.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Creates a temporary directory. This API uses an asynchronous callback to return the result.\n * The directory name is created by replacing a string (specified by prefix) with six randomly generated characters.\n *\n * @param { string } prefix - String to be replaced with six randomly generated characters to create a unique temporary directory.\n * @param { AsyncCallback<string> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function mkdtemp(prefix: string, callback: AsyncCallback<string>): void;\n/**\n * Make temp dir with sync interface.\n *\n * @param { string } prefix - dir prefix.\n * @returns { string } Returns the path to the new directory.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Creates a temporary directory. This API returns the result synchronously.\n * The directory name is created by replacing a string (specified by prefix) with six randomly generated characters.\n *\n * @param { string } prefix - String to be replaced with six randomly generated characters to create a unique temporary directory.\n * @returns { string } Unique path generated.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function mkdtempSync(prefix: string): string;\n/**\n * Moves the source directory to the destination directory. This API uses a promise to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { number } [mode = 0] - Move mode. The default value is 0.\n * <br>0: Throw an exception if a directory conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a non-empty directory with the same name as the source directory.\n * <br>1: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory\n * <br>will be moved to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>2: Forcibly overwrite the conflicting files in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * <br>3: Forcibly overwrite the conflicting directory.\n * <br>The source directory is moved to the destination directory, and the content of the moved directory is the\n * <br>same as that of the source directory. If the destination directory contains a directory with the same name\n * <br>as the source directory, all original files in the directory will be deleted.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function moveDir(src: string, dest: string, mode?: number): Promise<void>;\n/**\n * Moves the source directory to the destination directory. This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function moveDir(src: string, dest: string, callback: AsyncCallback<void>): void;\n/**\n * Moves the source directory to the destination directory. This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900015 - File exists\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function moveDir(src: string, dest: string, callback: AsyncCallback<void, Array<ConflictFiles>>): void;\n/**\n * Moves the source directory to the destination directory. You can set the move mode.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { number } mode - Move mode. The default value is 0.\n * <br>0: Throw an exception if a directory conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a non-empty directory with the same name as the source directory.\n * <br>1: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory\n * <br>will be moved to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>2: Forcibly overwrite the conflicting files in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * <br>3: Forcibly overwrite the conflicting directory.\n * <br>The source directory is moved to the destination directory, and the content of the moved directory is the\n * <br>same as that of the source directory. If the destination directory contains a directory with the same name\n * <br>as the source directory, all original files in the directory will be deleted.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback<void>): void;\n/**\n * Moves the source directory to the destination directory. You can set the move mode.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { number } mode - Move mode. The default value is 0.\n * <br>0: Throw an exception if a directory conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a non-empty directory with the same name as the source directory.\n * <br>1: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory\n * <br>will be moved to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>2: Forcibly overwrite the conflicting files in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * <br>3: Forcibly overwrite the conflicting directory.\n * <br>The source directory is moved to the destination directory, and the content of the moved directory is the\n * <br>same as that of the source directory. If the destination directory contains a directory with the same name\n * <br>as the source directory, all original files in the directory will be deleted.\n * @param { AsyncCallback<void, Array<ConflictFiles>> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900015 - File exists\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback<void, Array<ConflictFiles>>): void;\n/**\n * Moves the source directory to the destination directory. This API returns the result synchronously.\n *\n * @param { string } src - Application sandbox path of the source directory.\n * @param { string } dest - Application sandbox path of the destination directory.\n * @param { number } [mode = 0] - Move mode. The default value is 0.\n * <br>0: Throw an exception if a directory conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a non-empty directory with the same name as the source directory.\n * <br>1: Throw an exception if a file conflict occurs.\n * <br>An exception will be thrown if the destination directory contains a directory with the same name as the source directory,\n * <br>and a file with the same name exists in the conflict directory. All the non-conflicting files in the source directory\n * <br>will be moved to the destination directory, and the non-conflicting files in the destination directory will be retained.\n * <br>The data attribute in the error returned provides information about the conflicting files in the Array<ConflictFiles> format.\n * <br>2: Forcibly overwrite the conflicting files in the destination directory.\n * <br>When the destination directory contains a directory with the same name as the source directory,\n * <br>the files with the same names in the destination directory are overwritten forcibly;\n * <br>the files without conflicts in the destination directory are retained.\n * <br>3: Forcibly overwrite the conflicting directory.\n * <br>The source directory is moved to the destination directory, and the content of the moved directory is the\n * <br>same as that of the source directory. If the destination directory contains a directory with the same name\n * <br>as the source directory, all original files in the directory will be deleted.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare function moveDirSync(src: string, dest: string, mode?: number): void;\n/**\n * Move file.\n *\n * @param { string } src - source file path.\n * @param { string } dest - destination file path.\n * @param { number } [mode = 0] - move mode when duplicate file name exists.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Moves a file. This API uses a promise to return the result.\n *\n * @param { string } src - Application sandbox path of the file to move.\n * @param { string } dest - Application sandbox path of the destination file.\n * @param { number } [mode = 0] - Move mode.\n * <br>The value 0 means to overwrite the file with the same name in the destination directory;\n * <br>the value 1 means to throw an exception. The default value is 0.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function moveFile(src: string, dest: string, mode?: number): Promise<void>;\n/**\n * Move file.\n *\n * @param { string } src - source file path.\n * @param { string } dest - destination file path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Moves a file and forcibly overwrites the file with the same name in the destination directory.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the file to move.\n * @param { string } dest - Application sandbox path of the destination file.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function moveFile(src: string, dest: string, callback: AsyncCallback<void>): void;\n/**\n * Move file.\n *\n * @param { string } src - source file path.\n * @param { string } dest - destination file path.\n * @param { number } [mode = 0] - move mode when duplicate file name exists.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Moves a file with the specified mode. This API uses an asynchronous callback to return the result.\n *\n * @param { string } src - Application sandbox path of the file to move.\n * @param { string } dest - Application sandbox path of the destination to move.\n * @param { number } [mode = 0] - Move mode.\n * <br>The value 0 means to overwrite the file with the same name in the destination directory;\n * <br>the value 1 means to throw an exception. The default value is 0.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback<void>): void;\n/**\n * Move file with sync interface.\n *\n * @param { string } src - source file path.\n * @param { string } dest - destination file path.\n * @param { number } [mode = 0] - move mode when duplicate file name exists.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Moves a file. This API returns the result synchronously.\n *\n * @param { string } src - Application sandbox path of the file to move.\n * @param { string } dest - Application sandbox path of the destination to move.\n * @param { number } [mode = 0] - Move mode.\n * <br>The value 0 means to overwrite the file with the same name in the destination directory;\n * <br>the value 1 means to throw an exception. The default value is 0.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\ndeclare function moveFileSync(src: string, dest: string, mode?: number): void;\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { Promise<File> } Returns the File object in Promise mode to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Opens a file or directory. This API uses a promise to return the result. This API supports the use of a URI.\n *\n * @param { string } path - Application sandbox path or URI of the file.\n * @param { number } [mode = OpenMode.READ_ONLY] - Mode for opening the file.\n * <br>You must specify one of the following options. By default, the file is opened in read-only mode.\n * <br>OpenMode.READ_ONLY(0o0): Open the file in read-only mode.\n * <br>OpenMode.WRITE_ONLY(0o1): Open the file in write-only mode.\n * <br>OpenMode.READ_WRITE(0o2): Open the file in read/write mode.\n * <br>You can add the following function options in bitwise OR mode. By default, no additional option is added.\n * <br>OpenMode.CREATE(0o100): Create a file if the file does not exist.\n * <br>OpenMode.TRUNC(0o1000): If the file exists and is opened in write mode, truncate the file length to 0.\n * <br>OpenMode.APPEND(0o2000): Open the file in append mode. New data will be added to the end of the file.\n * <br>OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n * <br>or character special file, perform non-blocking operations on the opened file and in subsequent I/Os.\n * <br>OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n * <br>OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n * <br>OpenMode.SYNC(0o4010000): Open the file in synchronous I/O mode.\n * @returns { Promise<File> } Promise used to return the File object.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function open(path: string, mode?: number): Promise<File>;\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Opens a file or directory. This API uses an asynchronous callback to return the result. This API supports the use of a URI.\n *\n * @param { string } path - Application sandbox path or URI of the file.\n * @param { AsyncCallback<File> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function open(path: string, callback: AsyncCallback<File>): void;\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Open file.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Opens a file or directory with the specified mode. This API uses an asynchronous callback to return the result.\n * This API supports the use of a URI.\n *\n * @param { string } path - Application sandbox path or URI of the file.\n * @param { number } [mode = OpenMode.READ_ONLY] - Mode for opening the file.\n * <br>You must specify one of the following options. By default, the file is opened in read-only mode.\n * <br>OpenMode.READ_ONLY(0o0): Open the file in read-only mode.\n * <br>OpenMode.WRITE_ONLY(0o1): Open the file in write-only mode.\n * <br>OpenMode.READ_WRITE(0o2): Open the file in read/write mode.\n * <br>You can add the following function options in bitwise OR mode. By default, no additional option is added.\n * <br>OpenMode.CREATE(0o100): Create a file if the file does not exist.\n * <br>OpenMode.TRUNC(0o1000): If the file exists and is opened in write mode, truncate the file length to 0.\n * <br>OpenMode.APPEND(0o2000): Open the file in append mode. New data will be added to the end of the file.\n * <br>OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n * <br>or character special file, perform non-blocking operations on the opened file and in subsequent I/Os.\n * <br>OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n * <br>OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n * <br>OpenMode.SYNC(0o4010000): Open the file in synchronous I/O mode.\n * @param { AsyncCallback<File> } callback - The callback is used to return the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function open(path: string, mode: number, callback: AsyncCallback<File>): void;\n/**\n * Open file with sync interface.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { File } Returns the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Open file with sync interface.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { File } Returns the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Open file with sync interface.\n *\n * @param { string } path - path.\n * @param { number } [mode = OpenMode.READ_ONLY] - mode.\n * @returns { File } Returns the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Opens a file or directory. This API returns the result synchronously. This API supports the use of a URI.\n *\n * @param { string } path - Application sandbox path or file URI of the file to open.\n * @param { number } [mode = OpenMode.READ_ONLY] - Mode for opening the file.\n * <br>You must specify one of the following options. By default, the file is opened in read-only mode.\n * <br>OpenMode.READ_ONLY(0o0): Open the file in read-only mode.\n * <br>OpenMode.WRITE_ONLY(0o1): Open the file in write-only mode.\n * <br>OpenMode.READ_WRITE(0o2): Open the file in read/write mode.\n * <br>You can add the following function options in bitwise OR mode. By default, no additional option is added.\n * <br>OpenMode.CREATE(0o100): Create a file if the file does not exist.\n * <br>OpenMode.TRUNC(0o1000): If the file exists and is opened in write mode, truncate the file length to 0.\n * <br>OpenMode.APPEND(0o2000): Open the file in append mode. New data will be added to the end of the file.\n * <br>OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n * <br>or character special file, perform non-blocking operations on the opened file and in subsequent I/Os.\n * <br>OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n * <br>OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n * <br>OpenMode.SYNC(0o4010000): Open the file in synchronous I/O mode.\n * @returns { File } Returns the File object to record the file descriptor.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900006 - No such device or address\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900017 - No such device\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900029 - Resource deadlock would occur\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function openSync(path: string, mode?: number): File;\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { ReadOptions } [options] - options.\n * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Reads file data. This API uses a promise to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer } buffer - Buffer used to store the file data read.\n * @param { ReadOptions } [options] - The options are as follows:\n * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n * <br>offset (number): start position to read the data (it is determined by filePointer plus offset).\n * <br>This parameter is optional. By default, data is read from the filePointer.\n * @returns { Promise<number> } Promise used to return the length of the data read, in bytes.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function read(fd: number, buffer: ArrayBuffer, options?: ReadOptions): Promise<number>;\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Reads data from a file. This API uses an asynchronous callback to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer } buffer - Buffer used to store the file data read.\n * @param { AsyncCallback<number> } callback - Callback used to return the length of the data read, in bytes.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback<number>): void;\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { object } [options] - options.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { object } [options] - options.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Reads data from a file. This API uses an asynchronous callback to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer } buffer - Buffer used to store the file data read.\n * @param { ReadOptions } [options] - The options are as follows:\n * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n * <br>offset (number): start position to read the data (it is determined by filePointer plus offset).\n * <br>This parameter is optional. By default, data is read from the filePointer.\n * @param { AsyncCallback<number> } callback - Callback used to return the length of the data read, in bytes.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function read(fd: number, buffer: ArrayBuffer, options: ReadOptions, callback: AsyncCallback<number>): void;\n/**\n * Read file with sync interface.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { number } Returns the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read file with sync interface.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { number } Returns the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Read file with sync interface.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer } buffer - buffer.\n * @param { ReadOptions } [options] - options.\n * @returns { number } Returns the number of file bytes read to buffer.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Reads data from a file. This API returns the result synchronously.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer } buffer - Buffer used to store the file data read.\n * @param { ReadOptions } [options] - The options are as follows:\n * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n * <br>offset (number): start position to read the data (it is determined by filePointer plus offset).\n * <br>This parameter is optional. By default, data is read from the filePointer.\n * @returns { number } Length of the data read, in bytes.\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function readSync(fd: number, buffer: ArrayBuffer, options?: ReadOptions): number;\n/**\n * Read content line by line.\n *\n * @param { string } filePath - file path.\n * @param { Options } [options] - optional parameters\n * @returns { Promise<ReaderIterator> } Returns the iterator object in promise mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\n/**\n * Reads the text content of a file line by line. This API uses a promise to return the result.\n * Only the files in UTF-8 format are supported.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { Options } [options] - Options for reading the text. The options are as follows:\n * <br>encoding (string): format of the data to be encoded. It is valid only when the data is of the string type.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @returns { Promise<ReaderIterator> } Promise used to return a ReaderIterator object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function readLines(filePath: string, options?: Options): Promise<ReaderIterator>;\n/**\n * Reads a file text line by line. This API uses an asynchronous callback to return the result.\n * Only the files in UTF-8 format are supported.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { AsyncCallback<ReaderIterator> } callback - Callback used to return a ReaderIterator object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare function readLines(filePath: string, callback: AsyncCallback<ReaderIterator>): void;\n/**\n * Reads a file text line by line. This API uses an asynchronous callback to return the result.\n * Only the files in UTF-8 format are supported.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { Options } options - Options for reading the text. The options are as follows:\n * <br>encoding (string): format of the data to be encoded. It is valid only when the data is of the string type.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @param { AsyncCallback<ReaderIterator> } callback - Callback used to return a ReaderIterator object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare function readLines(filePath: string, options: Options, callback: AsyncCallback<ReaderIterator>): void;\n/**\n * Read content line by line with sync interface.\n *\n * @param { string } filePath - file path.\n * @param { Options } [options] - optional parameters\n * @returns { ReaderIterator } Returns the iterator object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\n/**\n * Reads the text content of a file line by line. This API returns the result synchronously.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { Options } [options] - Options for reading the text. The options are as follows:\n * <br>encoding (string): format of the data to be encoded. It is valid only when the data is of the string type.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @returns { ReaderIterator } Returns the iterator object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900022 - Too many open files\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function readLinesSync(filePath: string, options?: Options): ReaderIterator;\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { object } [options] - options.\n * @returns { Promise<string> } Returns the contents of the read file in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { object } [options] - options.\n * @returns { Promise<string> } Returns the contents of the read file in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { ReadTextOptions } [options] - options.\n * @returns { Promise<string> } Returns the contents of the read file in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Reads the text content of a file. This API uses a promise to return the result.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { ReadTextOptions } [options] - The options are as follows:\n * <br>offset (number): start position to read the data. This parameter is optional. By default, data is read from the current position.\n * <br>length (number): length of the data to read. This parameter is optional. The default value is the file length.\n * <br>encoding (string): format of the data to be encoded. It is valid only when the data is of the string type.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @returns { Promise<string> } Promise used to return the file content read.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function readText(filePath: string, options?: ReadTextOptions): Promise<string>;\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Reads the text content of a file. This API uses an asynchronous callback to return the result.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { AsyncCallback<string> } callback - Callback used to return the content read.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function readText(filePath: string, callback: AsyncCallback<string>): void;\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { object } [options] - options.\n * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read text.\n *\n * @param { string } filePath - file path.\n * @param { object } [options] - options.\n * @param { AsyncCallback<string> } callback - The callback is used to return the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Reads the text content of a file. This API uses an asynchronous callback to return the result.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { ReadTextOptions } [options] - The options are as follows:\n * <br>offset (number): start position to read the data. This parameter is optional. By default, data is read from the current position.\n * <br>length (number): length of the data to read. This parameter is optional. The default value is the file length.\n * <br>encoding (string): format of the data to be encoded. It is valid only when the data is of the string type.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @param { AsyncCallback<string> } callback - Callback used to return the content read.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function readText(filePath: string, options: ReadTextOptions, callback: AsyncCallback<string>): void;\n/**\n * Read text with sync interface.\n *\n * @param { string } filePath - file path.\n * @param { object } [options] - options.\n * @returns { string } Returns the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Read text with sync interface.\n *\n * @param { string } filePath - file path.\n * @param { object } [options] - options.\n * @returns { string } Returns the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Read text with sync interface.\n *\n * @param { string } filePath - file path.\n * @param { ReadTextOptions } [options] - options.\n * @returns { string } Returns the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\n/**\n * Reads the text of a file. This API returns the result synchronously.\n *\n * @param { string } filePath - Application sandbox path of the file.\n * @param { ReadTextOptions } [options] - The options are as follows:\n * <br>offset (number): start position to read the data. This parameter is optional. By default, data is read from the current position.\n * <br>length (number): length of the data to read. This parameter is optional. The default value is the file length.\n * <br>encoding (string): format of the data to be encoded. It is valid only when the data is of the string type.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @returns { string } Returns the contents of the read file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @throws { BusinessError } 13900044 - Network is unreachable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 12\n */\ndeclare function readTextSync(filePath: string, options?: ReadTextOptions): string;\n/**\n * Rename file.\n *\n * @param { string } oldPath - oldPath.\n * @param { string } newPath - newPath.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Rename file.\n *\n * @param { string } oldPath - oldPath.\n * @param { string } newPath - newPath.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Renames a file or directory. This API uses a promise to return the result.\n *\n * @param { string } oldPath - Application sandbox path of the file or directory to rename.\n * @param { string } newPath - Application sandbox path of the renamed file or directory.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function rename(oldPath: string, newPath: string): Promise<void>;\n/**\n * Rename file.\n *\n * @param { string } oldPath - oldPath.\n * @param { string } newPath - newPath.\n * @param { AsyncCallback<void> } callback - Returns the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Rename file.\n *\n * @param { string } oldPath - oldPath.\n * @param { string } newPath - newPath.\n * @param { AsyncCallback<void> } callback - Returns the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Renames a file or directory. This API uses an asynchronous callback to return the result.\n *\n * @param { string } oldPath - Application sandbox path of the file or directory to rename.\n * @param { string } newPath - Application sandbox path of the renamed file or directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function rename(oldPath: string, newPath: string, callback: AsyncCallback<void>): void;\n/**\n * Rename file with sync interface.\n *\n * @param { string } oldPath - oldPath.\n * @param { string } newPath - newPath.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Rename file with sync interface.\n *\n * @param { string } oldPath - oldPath.\n * @param { string } newPath - newPath.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Renames a file or directory. This API returns the result synchronously.\n *\n * @param { string } oldPath - Application sandbox path of the file or directory to rename.\n * @param { string } newPath - Application sandbox path of the renamed file or directory.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900016 - Cross-device link\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900028 - Too many links\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function renameSync(oldPath: string, newPath: string): void;\n/**\n * Delete dir.\n *\n * @param { string } path - path.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Delete dir.\n *\n * @param { string } path - path.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Removes a directory. This API uses a promise to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function rmdir(path: string): Promise<void>;\n/**\n * Delete dir.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Delete dir.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Removes a directory. This API uses an asynchronous callback to return the result.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function rmdir(path: string, callback: AsyncCallback<void>): void;\n/**\n * Delete dir with sync interface.\n *\n * @param { string } path - path.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Delete dir with sync interface.\n *\n * @param { string } path - path.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Removes a directory. This API returns the result synchronously.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system1\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900032 - Directory not empty\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function rmdirSync(path: string): void;\n/**\n * Get file information.\n *\n * @param { string | number } file - path or file descriptor.\n * @returns { Promise<Stat> } Returns the Stat object in promise mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Get file information.\n *\n * @param { string | number } file - path or file descriptor.\n * @returns { Promise<Stat> } Returns the Stat object in promise mode.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Obtains detailed attribute information of a file or directory. This API uses a promise to return the result.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @returns { Promise<Stat> } Promise used to return detailed file information.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function stat(file: string | number): Promise<Stat>;\n/**\n * Get file information.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { AsyncCallback<Stat> } callback - The callback is used to return the Stat object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Get file information.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { AsyncCallback<Stat> } callback - The callback is used to return the Stat object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Obtains detailed attribute information of a file or directory.\n * This API uses an asynchronous callback to return the result.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @param { AsyncCallback<Stat> } callback - Callback used to return the file information obtained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function stat(file: string | number, callback: AsyncCallback<Stat>): void;\n/**\n * Get file information with sync interface.\n *\n * @param { string | number } file - path or file descriptor.\n * @returns { Stat } Returns the Stat object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Get file information with sync interface.\n *\n * @param { string | number } file - path or file descriptor.\n * @returns { Stat } Returns the Stat object.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Obtains detailed attribute information of a file or directory. This API returns the result synchronously.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @returns { Stat } File information obtained.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function statSync(file: string | number): Stat;\n/**\n * Creates a symbolic link based on a file path. This API uses a promise to return the result.\n *\n * @param { string } target - Application sandbox path of the target file.\n * @param { string } srcPath - Application sandbox path of the symbolic link.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\ndeclare function symlink(target: string, srcPath: string): Promise<void>;\n/**\n * Creates a symbolic link based on a file path. This API uses an asynchronous callback to return the result.\n *\n * @param { string } target - Application sandbox path of the target file.\n * @param { string } srcPath - Application sandbox path of the symbolic link.\n * @param { AsyncCallback<void> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\ndeclare function symlink(target: string, srcPath: string, callback: AsyncCallback<void>): void;\n/**\n * Creates a symbolic link based on a file path. This API returns the result synchronously.\n *\n * @param { string } target - Application sandbox path of the target file.\n * @param { string } srcPath - Application sandbox path of the symbolic link.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900015 - File exists\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\ndeclare function symlinkSync(target: string, srcPath: string): void;\n/**\n * Truncate file.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { number } [len = 0] - len.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Truncate file.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { number } [len = 0] - len.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Truncates a file. This API uses a promise to return the result.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @param { number } [len = 0] - File length, in bytes, after truncation. The default value is 0.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function truncate(file: string | number, len?: number): Promise<void>;\n/**\n * Truncate file.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Truncate file.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Truncates a file. This API uses an asynchronous callback to return the result.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @param { AsyncCallback<void> } callback - Callback that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function truncate(file: string | number, callback: AsyncCallback<void>): void;\n/**\n * Truncate file.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { number } [len = 0] - len.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Truncate file.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { number } [len = 0] - len.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Truncates a file. This API uses an asynchronous callback to return the result.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @param { number } len - File length, in bytes, after truncation.\n * @param { AsyncCallback<void> } callback - Callback that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function truncate(file: string | number, len: number, callback: AsyncCallback<void>): void;\n/**\n * Truncate file with sync interface.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { number } [len = 0] - len.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Truncate file with sync interface.\n *\n * @param { string | number } file - path or file descriptor.\n * @param { number } [len = 0] - len.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Truncates the file content. This API returns the result synchronously.\n *\n * @param { string | number } file - Application sandbox path or FD of the file.\n * @param { number } [len = 0] - File length, in bytes, after truncation. The default value is 0.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900023 - Text file busy\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function truncateSync(file: string | number, len?: number): void;\n/**\n * Delete file.\n *\n * @param { string } path - path.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Delete file.\n *\n * @param { string } path - path.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Deletes a file. This API uses a promise to return the result.\n *\n * @param { string } path - Application sandbox path of the file.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function unlink(path: string): Promise<void>;\n/**\n * Delete file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Delete file.\n *\n * @param { string } path - path.\n * @param { AsyncCallback<void> } callback - Return the callback function.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Deletes a file. This API uses an asynchronous callback to return the result.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { AsyncCallback<void> } callback - Callback invoked immediately after the file is deleted.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function unlink(path: string, callback: AsyncCallback<void>): void;\n/**\n * Delete file with sync interface.\n *\n * @param { string } path - path.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Delete file with sync interface.\n *\n * @param { string } path - path.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Deletes a file. This API returns the result synchronously.\n *\n * @param { string } path - Application sandbox path of the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900014 - Device or resource busy\n * @throws { BusinessError } 13900018 - Not a directory\n * @throws { BusinessError } 13900019 - Is a directory\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900030 - File name too long\n * @throws { BusinessError } 13900033 - Too many symbolic links encountered\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function unlinkSync(path: string): void;\n/**\n * Change file mtime.\n *\n * @param { string } path - path.\n * @param { number } mtime - last modification time\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\n/**\n * Updates the latest access timestamp of a file.\n *\n * @param { string } path - Application sandbox path of the file.\n * @param { number } mtime - New timestamp. The value is the number of milliseconds elapsed since the Epoch time (00:00:00 UTC on January 1, 1970).\n * <br>Only the last access time of a file can be modified.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900027 - Read-only file system\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 12\n */\ndeclare function utimes(path: string, mtime: number): void;\n/**\n * Write file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Write file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Writes data into a file. This API uses a promise to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n * @param { WriteOptions } [options] - Defines the options use din write(). It inherits from Options.\n * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function write(fd: number, buffer: ArrayBuffer | string, options?: WriteOptions): Promise<number>;\n/**\n * Write file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Write file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Writes data to a file. This API uses an asynchronous callback to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n * @param { AsyncCallback<number> } callback - Callback used to return the result.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback<number>): void;\n/**\n * Write file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { object } [options] - options.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Write file.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { object } [options] - options.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Writes data to a file. This API uses an asynchronous callback to return the result.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n * @param { WriteOptions } [options] - The options are as follows:\n * <br>length (number): length of the data to write. This parameter is optional. The default value is the buffer length.\n * <br>offset (number): start position to write the data in the file. This parameter is optional.\n * <br>By default, data is written from the current position.\n * <br>encoding (string): format of the data to be encoded when the data is a string.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function write(fd: number, buffer: ArrayBuffer | string, options: WriteOptions, callback: AsyncCallback<number>): void;\n/**\n * Write file with sync interface.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { number } Returns the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Write file with sync interface.\n *\n * @param { number } fd - file descriptor.\n * @param { ArrayBuffer | string } buffer - buffer.\n * @param { object } [options] - options.\n * @returns { number } Returns the number of bytes written to the file.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Writes data to a file. This API returns the result synchronously.\n *\n * @param { number } fd - FD of the file.\n * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n * @param { WriteOptions } [options] - The options are as follows:\n * <br>length (number): length of the data to write. This parameter is optional. The default value is the buffer length.\n * <br>offset (number): start position to write the data in the file. This parameter is optional.\n * <br>By default, data is written from the current position.\n * <br>encoding (string): format of the data to be encoded when the data is a string.\n * <br>The default value is 'utf-8', which is the only value supported.\n * @returns { number } Length of the data written, in bytes.\n * @throws { BusinessError } 13900001 - Operation not permitted\n * @throws { BusinessError } 13900004 - Interrupted system call\n * @throws { BusinessError } 13900005 - I/O error\n * @throws { BusinessError } 13900008 - Bad file descriptor\n * @throws { BusinessError } 13900010 - Try again\n * @throws { BusinessError } 13900013 - Bad address\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900024 - File too large\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900034 - Operation would block\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare function writeSync(fd: number, buffer: ArrayBuffer | string, options?: WriteOptions): number;\n/**\n * Connect Distributed File System.\n *\n * @permission ohos.permission.DISTRIBUTED_DATASYNC\n * @param { string } networkId - The networkId of device.\n * @param { DfsListeners } listeners - The listeners of Distributed File System.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 201 - Permission denied.\n * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900045 - Connection failed.\n * @throws { BusinessError } 13900046 - Software caused connection abort.\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function connectDfs(networkId: string, listeners: DfsListeners): Promise<void>;\n/**\n * Disconnect Distributed File System.\n *\n * @permission ohos.permission.DISTRIBUTED_DATASYNC\n * @param { string } networkId - The networkId of device.\n * @returns { Promise<void> } The promise returned by the function.\n * @throws { BusinessError } 201 - Permission denied.\n * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13600004 - Unmount failed.\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function disconnectDfs(networkId: string): Promise<void>;\n/**\n * Sets an extended attribute of a file or directory.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { string } key - Key of the extended attribute to obtain.\n * <br>The value is a string of less than 256 bytes and can contain only the user. prefix.\n * @param { string } value -Value of the extended attribute to set.\n * @returns { Promise<void> } Promise that returns no value.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function setxattr(path: string, key: string, value: string): Promise<void>;\n/**\n * Sets an extended attribute of a file or directory.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { string } key - Key of the extended attribute to obtain.\n * <br>The value is a string of less than 256 bytes and can contain only the user. prefix.\n * @param { string } value - Value of the extended attribute to set.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900011 - Out of memory\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900020 - Invalid argument\n * @throws { BusinessError } 13900025 - No space left on device\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900041 - Quota exceeded\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function setxattrSync(path: string, key: string, value: string): void;\n/**\n * Obtains an extended attribute of a file or directory.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { string } key - Key of the extended attribute to obtain.\n * @returns { Promise<string> } Promise used to return the value of the extended attribute obtained.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900007 - Arg list too long\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900037 - No data available\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function getxattr(path: string, key: string): Promise<string>;\n/**\n * Obtains an extended attribute of a file. This API returns the result synchronously.\n *\n * @param { string } path - Application sandbox path of the directory.\n * @param { string } key - Key of the extended attribute to obtain.\n * @returns { string } Value of the extended attribute obtained.\n * @throws { BusinessError } 401 - Parameter error.Possible causes:1.Mandatory parameters are left unspecified;\n * <br>2.Incorrect parameter types.\n * @throws { BusinessError } 13900002 - No such file or directory\n * @throws { BusinessError } 13900007 - Arg list too long\n * @throws { BusinessError } 13900012 - Permission denied\n * @throws { BusinessError } 13900031 - Function not implemented\n * @throws { BusinessError } 13900037 - No data available\n * @throws { BusinessError } 13900038 - Value too large for defined data type\n * @throws { BusinessError } 13900042 - Unknown error\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare function getxattrSync(path: string, key: string): string;\n/**\n * Defines the copy progress information.\n *\n * @typedef Progress\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ninterface Progress {\n    /**\n     * Size of the copied data.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    readonly processedSize: number;\n    /**\n     * Total size of the data to be copied.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    readonly totalSize: number;\n}\n/**\n * Provides APIs for interrupting a copy task.\n *\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\nexport class TaskSignal {\n    /**\n     * Cancels a copy task.\n     *\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900012 - Permission denied by the file system\n     * @throws { BusinessError } 13900043 - No task can be canceled.\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    cancel(): void;\n    /**\n     * Subscribes to the event reported when a copy task is canceled.\n     *\n     * @returns { Promise<string> } Return the result of the cancel event.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    onCancel(): Promise<string>;\n}\n/**\n * Defines the callback for listening for the copy progress.\n *\n * @typedef CopyOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ninterface CopyOptions {\n    /**\n     * Listener used to observe the copy progress.\n     *\n     * @type { ?ProgressListener }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    progressListener?: ProgressListener;\n    /**\n     * Signal used to cancel a copy task.\n     *\n     * @type { ?TaskSignal }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    copySignal?: TaskSignal;\n}\n/**\n * Signal used to cancel a copy task.\n *\n * @typedef { function } ProgressListener\n * @param { Progress } progress - indicates the progress data of copyFile\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ntype ProgressListener = (progress: Progress) => void;\n/**\n * File object.\n *\n * @interface File\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * File object.\n *\n * @interface File\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Represents a File object opened by open().\n *\n * @interface File\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare interface File {\n    /**\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * FD of the file.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    readonly fd: number;\n    /**\n     * Path of the file.\n     *\n     * @type { string }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 14300002 - Invalid URI\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly path: string;\n    /**\n     * Name of the file.\n     *\n     * @type { string }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly name: string;\n    /**\n     * Obtains the parent directory of this file object.\n     *\n     * @returns { string } Parent directory obtained.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 14300002 - Invalid URI\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    getParent(): string;\n    /**\n     * Applies an exclusive lock or a shared lock on this file in blocking mode.\n     * This API uses a promise to return the result.\n     *\n     * @param { boolean } exclusive - Lock to apply. The value true means an exclusive lock,\n     * <br>and the value false (default) means a shared lock.\n     * @returns { Promise<void> } Promise that returns no value.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900043 - No record locks available\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    lock(exclusive?: boolean): Promise<void>;\n    /**\n     * Applies an exclusive lock or a shared lock on this file in blocking mode.\n     * This API uses an asynchronous callback to return the result.\n     *\n     * @param { AsyncCallback<void> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900043 - No record locks available\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    lock(callback: AsyncCallback<void>): void;\n    /**\n     * Applies an exclusive lock or a shared lock on this file in blocking mode.\n     * This API uses an asynchronous callback to return the result.\n     *\n     * @param { boolean } exclusive - Lock to apply. The value true means an exclusive lock,\n     * <br>and the value false (default) means a shared lock.\n     * @param { AsyncCallback<void> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900043 - No record locks available\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    lock(exclusive: boolean, callback: AsyncCallback<void>): void;\n    /**\n     * Applies an exclusive lock or a shared lock on this file in non-blocking mode.\n     *\n     * @param { boolean } exclusive - Lock to apply. The value true means an exclusive lock,\n     * <br>and the value false (default) means a shared lock.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900043 - No record locks available\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    tryLock(exclusive?: boolean): void;\n    /**\n     * Unlocks a file.\n     *\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900043 - No record locks available\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    unlock(): void;\n}\n/**\n * Provides APIs for randomly reading and writing a stream. Before invoking any API of RandomAccessFile,\n * you need to use createRandomAccessFile() to create a RandomAccessFile instance synchronously or asynchronously\n *\n * @interface RandomAccessFile\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\ndeclare interface RandomAccessFile {\n    /**\n     * FD of the file.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly fd: number;\n    /**\n     * Offset pointer to the RandomAccessFile instance.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly filePointer: number;\n    /**\n     * Sets the file offset pointer.\n     *\n     * @param { number } filePointer - Offset pointer to the RandomAccessFile instance.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    setFilePointer(filePointer: number): void;\n    /**\n     * Closes this RandomAccessFile instance. This API returns the result synchronously.\n     *\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    close(): void;\n    /**\n     * Write randomAccessFile.\n     *\n     * @param { ArrayBuffer | string } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Writes data into a file. This API uses a promise to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data (it is determined by filePointer plus offset).\n     * <br>This parameter is optional. By default, data is written from the filePointer.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @returns { Promise<number> } Returns the number of bytes written to the file in promise mode.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    write(buffer: ArrayBuffer | string, options?: WriteOptions): Promise<number>;\n    /**\n     * Writes data to a file. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    write(buffer: ArrayBuffer | string, callback: AsyncCallback<number>): void;\n    /**\n     * Write randomAccessFile.\n     *\n     * @param { ArrayBuffer | string } buffer - buffer.\n     * @param { object } [options] - options.\n     * @param { AsyncCallback<number> } callback - The callback is used to return the number of bytes written to the file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Writes data to a file. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data (it is determined by filePointer plus offset).\n     * <br>This parameter is optional. By default, data is written from the filePointer.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    write(buffer: ArrayBuffer | string, options: WriteOptions, callback: AsyncCallback<number>): void;\n    /**\n     * Write randomAccessFile with sync interface.\n     *\n     * @param { ArrayBuffer | string } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { number } Returns the number of bytes written to the file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Writes data to a file. This API returns the result synchronously.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data (it is determined by filePointer plus offset).\n     * <br>This parameter is optional. By default, data is written from the filePointer.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @returns { number } Length of the data written in the file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    writeSync(buffer: ArrayBuffer | string, options?: WriteOptions): number;\n    /**\n     * Read randomAccessFile.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Read randomAccessFile.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { ReadOptions } [options] - options.\n     * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Reads data from a file. This API uses a promise to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data (it is determined by filePointer plus offset).\n     * <br>This parameter is optional. By default, data is read from the filePointer.\n     * @returns { Promise<number> } Promise used to return the data read.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900044 - Network is unreachable\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    read(buffer: ArrayBuffer, options?: ReadOptions): Promise<number>;\n    /**\n     * Reads data from a file. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    read(buffer: ArrayBuffer, callback: AsyncCallback<number>): void;\n    /**\n     * Read randomAccessFile.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { object } [options] - options.\n     * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Reads data from a file. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data (it is determined by filePointer plus offset).\n     * <br>This parameter is optional. By default, data is read from the filePointer.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    read(buffer: ArrayBuffer, options: ReadOptions, callback: AsyncCallback<number>): void;\n    /**\n     * Read randomAccessFile with sync interface.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { number } Returns the number of file bytes read to buffer.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Read randomAccessFile with sync interface.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { ReadOptions } [options] - options.\n     * @returns { number } Returns the number of file bytes read to buffer.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Reads data from a file. This API returns the result synchronously.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data (it is determined by filePointer plus offset).\n     * <br>This parameter is optional. By default, data is read from the filePointer.\n     * @returns { number } Returns the number of file bytes read to buffer.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900044 - Network is unreachable\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    readSync(buffer: ArrayBuffer, options?: ReadOptions): number;\n    /**\n     * Obtains a ReadStream instance of this RandomAccessFile.\n     *\n     * @returns { ReadStream } ReadStream instance obtained.\n     * @throws { BusinessError } 401 - Parameter error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900011 - Out of memory\n     * @throws { BusinessError } 13900012 - Permission denied\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    getReadStream(): ReadStream;\n    /**\n     * Obtains a WriteStream instance of this RandomAccessFile.\n     *\n     * @returns { WriteStream } WriteStream instance obtained.\n     * @throws { BusinessError } 401 - Parameter error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900011 - Out of memory\n     * @throws { BusinessError } 13900012 - Permission denied\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    getWriteStream(): WriteStream;\n}\n/**\n * Defines a readable stream. You need to use fs.createReadStream to create a ReadStream instance,\n * which is inherited from the stream base class.\n * The data obtained by ReadStream is a decoded string. Currently, only the UTF-8 format is supported.\n *\n * @extends stream.Readable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare class ReadStream extends stream.Readable {\n    /**\n     * The ReadStream constructor.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    constructor();\n    /**\n     * Number of bytes read by the readable stream.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    readonly bytesRead: number;\n    /**\n     * Path of the file corresponding to the readable stream.\n     *\n     * @type { string }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    readonly path: string;\n    /**\n     * Adjusts the position of the readable stream offset pointer.\n     *\n     * @param { number } offset - Number of bytes to move the offset.\n     * @param { WhenceType } [whence = WhenceType.SEEK_SET] - Where to start the offset. The default value is SEEK_SET,\n     * <br>which indicates the beginning of the file.\n     * @returns { number } Returns the offset relative to starting position of stream.\n     * @throws { BusinessError } 401 - Parameter error\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900026 - Illegal seek\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    seek(offset: number, whence?: WhenceType): number;\n    /**\n     * Closes this readable stream.\n     *\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    close(): void;\n}\n/**\n * Defines a writeable stream. You need to use fs.createWriteStream to create a WriteStream instance,\n * which is inherited from the stream base class.\n *\n * @extends stream.Writable\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare class WriteStream extends stream.Writable {\n    /**\n     * The WriteStream constructor.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    constructor();\n    /**\n     * Number of bytes written to the writable stream.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    readonly bytesWritten: number;\n    /**\n     * Path of the file corresponding to the writeable stream.\n     *\n     * @type { string }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    readonly path: string;\n    /**\n     * Adjusts the position of the writeable stream offset pointer.\n     *\n     * @param { number } offset - Number of bytes to move the offset.\n     * @param { WhenceType } [whence = WhenceType.SEEK_SET] - Where to start the offset. The default value is SEEK_SET, which indicates the beginning of the file.\n     * @returns { number } Position of the current offset pointer (offset relative to the file header, in bytes).\n     * @throws { BusinessError } 401 - Parameter error\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900026 - Illegal seek\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    seek(offset: number, whence?: WhenceType): number;\n    /**\n     * Closes this writeable stream.\n     *\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    close(): void;\n}\n/**\n * AtomicFile is a class used to perform atomic read and write operations on files.\n * A temporary file is written and renamed to the original file location, which ensures file integrity.\n * If the write operation fails, the temporary file is deleted without modifying the original file content.\n * You can call finishWrite() or failWrite() to write or roll back file content.\n *\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 15\n */\nexport class AtomicFile {\n    /**\n     * The AtomicFile constructor.\n     *\n     * @param { string } path - Application sandbox path of the file.\n     * @throws { BusinessError } 401 Parameter error.Possible causes:1.Mandatory parameters are left unspecified; 2.Incorrect parameter types.\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    constructor(path: string);\n    /**\n     * Obtains the file object through the AtomicFile object. The FD needs to be closed by calling close().\n     *\n     * @returns { File } Returns the file object.\n     * @throws { BusinessError } 13900002 No such file or directory\n     * @throws { BusinessError } 13900005 IO error\n     * @throws { BusinessError } 13900012 Permission denied\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    getBaseFile(): File;\n    /**\n     * Creates a ReadStream instance.\n     *\n     * @returns { ReadStream } ReadStream instance obtained.\n     * @throws { BusinessError } 13900001 Operation not permitted\n     * @throws { BusinessError } 13900002 No such file or directory\n     * @throws { BusinessError } 13900012 Permission denied\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    openRead(): ReadStream;\n    /**\n     * Reads all content of a file.\n     *\n     * @returns { ArrayBuffer } Full content of a file.\n     * @throws { BusinessError } 13900005 I/O error\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    readFully(): ArrayBuffer;\n    /**\n     * Starts to write new file data in the WriteStream object returned. If the file does not exist, create a file.\n     * Call finishWrite() if the write operation is successful; call failWrite() if the write operation fails.\n     *\n     * @returns { WriteStream } Returns the file write stream.\n     * @throws { BusinessError } 13900001 Operation not permitted\n     * @throws { BusinessError } 13900002 No such file or directory\n     * @throws { BusinessError } 13900012 Permission denied\n     * @throws { BusinessError } 13900027 Read-only file system\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    startWrite(): WriteStream;\n    /**\n     * Finishes writing file data when the write operation is complete.\n     *\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    finishWrite(): void;\n    /**\n     * Rolls back the file after the file fails to be written.\n     *\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    failWrite(): void;\n    /**\n     * Deletes the AtomicFile class, including the original files and temporary files.\n     *\n     * @throws { BusinessError } 13900001 Operation not permitted\n     * @throws { BusinessError } 13900002 No such file or directory\n     * @throws { BusinessError } 13900012 Permission denied\n     * @throws { BusinessError } 13900027 Read-only file system\n     * @throws { BusinessError } 13900042 Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    delete(): void;\n}\n/**\n * Stat object.\n *\n * @interface Stat\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Stat object.\n *\n * @interface Stat\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Represents detailed file information. Before calling any API of the Stat() class,\n * use stat() to create a Stat instance.\n *\n * @interface Stat\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\ndeclare interface Stat {\n    /**\n     * @type { bigint }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * File identifier, which varies with files on the same device.\n     *\n     * @type { bigint }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    readonly ino: bigint;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * File permissions. The meaning of each bit is as follows:\n     * The following values are in octal format. The return values are in decimal format. You need to convert the values.\n     * 0o400: The user has the read permission on a regular file or a directory entry.\n     * 0o200: The user has the permission to write a regular file or create and delete a directory entry.\n     * 0o100: The user has the permission to execute a regular file or search for the specified path in a directory.\n     * 0o040: The user group has the read permission on a regular file or a directory entry.\n     * 0o020: The user group has the permission to write a regular file or create and delete a directory entry.\n     * 0o010: The user group has the permission to execute a regular file or search for the specified path in a directory.\n     * 0o004: Other users have the permission to read a regular file or read a directory entry.\n     * 0o002: Other users have the permission to write a regular file or create and delete a directory entry.\n     * 0o001: Other users have the permission to execute a regular file or search for the specified path in a directory.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    readonly mode: number;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * ID of the file owner.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    readonly uid: number;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * ID of the user group of the file.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    readonly gid: number;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * File size, in bytes. This parameter is valid only for regular files.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    readonly size: number;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * Time when the file was last accessed. The value is the number of seconds elapsed since 00:00:00 on January 1, 1970.\n     * NOTE: Currently, user data partitions are mounted in noatime mode by default, and atime update is disabled.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    readonly atime: number;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * Time when the file content was last modified. The value is the number of seconds elapsed\n     * since 00:00:00 on January 1, 1970.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    readonly mtime: number;\n    /**\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Time when the file metadata was last modified. The value is the number of seconds elapsed\n     * since 00:00:00 on January 1, 1970.\n     *\n     * @type { number }\n     * @readonly\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    readonly ctime: number;\n    /**\n     * Time of the last access to the file. The value is the number of nanoseconds elapsed\n     * since 00:00:00 on January 1, 1970.\n     * NOTE: Currently, user data partitions are mounted in noatime mode by default, and atime update is disabled.\n     *\n     * @type { bigint }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    readonly atimeNs?: bigint;\n    /**\n     * Time of the last modification to the file. The value is the number of\n     * nanoseconds elapsed since 00:00:00 on January 1, 1970.\n     *\n     * @type { bigint }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    readonly mtimeNs?: bigint;\n    /**\n     * Time of the last status change of the file. The value is the number of nanoseconds elapsed\n     * since 00:00:00 on January 1, 1970.\n     *\n     * @type { bigint }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Internal error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 15\n     */\n    readonly ctimeNs?: bigint;\n    /**\n     * File location, which indicates whether the file is stored in a local device or in the cloud.\n     *\n     * @type { LocationType }\n     * @readonly\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    readonly location: LocationType;\n    /**\n     * Whether path/fd is block device.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a block device or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Checks whether this file is a block special file. A block special file supports access by block only, and it is cached when accessed.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a block device or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    isBlockDevice(): boolean;\n    /**\n     * Whether path/fd is character device.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a character device or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Checks whether this file is a character special file. A character special device supports random access, and it is not cached when accessed.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a character device or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    isCharacterDevice(): boolean;\n    /**\n     * Whether path/fd is directory.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a directory or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Whether path/fd is directory.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a directory or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * Checks whether this file is a directory.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a directory or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    isDirectory(): boolean;\n    /**\n     * Whether path/fd is fifo.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a fifo file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Checks whether this file is a named pipe (or FIFO). Named pipes are used for inter-process communication.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a fifo file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    isFIFO(): boolean;\n    /**\n     * Whether path/fd is file.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a normal file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Whether path/fd is file.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a normal file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    /**\n     * Checks whether this file is a regular file.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a normal file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    isFile(): boolean;\n    /**\n     * Whether path/fd is socket.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a socket file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Checks whether this file is a socket.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a socket file or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    isSocket(): boolean;\n    /**\n     * Whether path/fd is symbolic link.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a symbolic link or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Checks whether this file is a symbolic link.\n     *\n     * @returns { boolean } Returns whether the path/fd point to a symbolic link or not.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @since 10\n     */\n    isSymbolicLink(): boolean;\n}\n/**\n * Provides API for stream operations. Before calling any API of Stream,\n * you need to create a Stream instance by using fs.createStream or fs.fdopenStream.\n *\n * @interface Stream\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 9\n */\n/**\n * Provides API for stream operations. Before calling any API of Stream,\n * you need to create a Stream instance by using fs.createStream or fs.fdopenStream.\n *\n * @interface Stream\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 20\n */\ndeclare interface Stream {\n    /**\n     * Close stream.\n     *\n     * @returns { Promise<void> } The promise returned by the function.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Close stream.\n     *\n     * @returns { Promise<void> } The promise returned by the function.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    close(): Promise<void>;\n    /**\n     * Close stream.\n     *\n     * @param { AsyncCallback<void> } callback - Return the callback function.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Close stream.\n     *\n     * @param { AsyncCallback<void> } callback - Return the callback function.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    close(callback: AsyncCallback<void>): void;\n    /**\n     * Close stream with sync interface.\n     *\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Close stream with sync interface.\n     *\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    closeSync(): void;\n    /**\n     * Flushes this stream. This API uses a promise to return the result.\n     *\n     * @returns { Promise<void> } The promise returned by the function.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Flushes this stream. This API uses a promise to return the result.\n     *\n     * @returns { Promise<void> } The promise returned by the function.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    flush(): Promise<void>;\n    /**\n     * Flush stream.\n     *\n     * @param { AsyncCallback<void> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Flushes this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { AsyncCallback<void> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    flush(callback: AsyncCallback<void>): void;\n    /**\n     * Flushes this stream. This API returns the result synchronously.\n     *\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Flushes this stream. This API returns the result synchronously.\n     *\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    flushSync(): void;\n    /**\n     * Write stream.\n     *\n     * @param { ArrayBuffer | string } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { Promise<number> } Returns the number of file bytes written to file in promise mode.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Writes data to this stream. This API uses a promise to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data in the file. This parameter is optional.\n     * <br>By default, data is written from the current position.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @returns { Promise<number> } Promise used to return the length of the data written.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Writes data to this stream. This API uses a promise to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data in the file. This parameter is optional.\n     * <br>By default, data is written from the current position.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @returns { Promise<number> } Promise used to return the length of the data written.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    write(buffer: ArrayBuffer | string, options?: WriteOptions): Promise<number>;\n    /**\n     * Writes data to this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes written to file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n    /**\n     * Writes data to this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes written to file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    write(buffer: ArrayBuffer | string, callback: AsyncCallback<number>): void;\n    /**\n     * Write stream.\n     *\n     * @param { ArrayBuffer | string } buffer - buffer.\n     * @param { object } [options] - options.\n     * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes written to file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Writes data to this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data in the file. This parameter is optional.\n     * <br>By default, data is written from the current position.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Writes data to this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data in the file. This parameter is optional.\n     * <br>By default, data is written from the current position.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    write(buffer: ArrayBuffer | string, options: WriteOptions, callback: AsyncCallback<number>): void;\n    /**\n     * Write stream with sync interface.\n     *\n     * @param { ArrayBuffer | string } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { number } Returns the number of file bytes written to file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Writes data to this stream. This API returns the result synchronously.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data in the file. This parameter is optional.\n     * <br>By default, data is written from the current position.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @returns { number } Length of the data written in the file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Writes data to this stream. This API returns the result synchronously.\n     *\n     * @param { ArrayBuffer | string } buffer - Data to write. It can be a string or data from a buffer.\n     * @param { WriteOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to write. The default value is the buffer length.\n     * <br>offset (number): start position to write the data in the file. This parameter is optional.\n     * <br>By default, data is written from the current position.\n     * <br>encoding (string): format of the data to be encoded when the data is a string.\n     * <br>The default value is 'utf-8', which is the only value supported.\n     * @returns { number } Length of the data written in the file.\n     * @throws { BusinessError } 13900001 - Operation not permitted\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900024 - File too large\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900041 - Quota exceeded\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    writeSync(buffer: ArrayBuffer | string, options?: WriteOptions): number;\n    /**\n     * Read stream.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Read stream.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { ReadOptions } [options] - options.\n     * @returns { Promise<number> } Returns the number of file bytes read to buffer in promise mode.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Reads data from the stream. This API uses a promise to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data. This parameter is optional. By default,\n     * <br>data is read from the current position.\n     * @returns { Promise<number> } Promise used to return the data read.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900044 - Network is unreachable\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    /**\n     * Reads data from the stream. This API uses a promise to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data. This parameter is optional. By default,\n     * <br>data is read from the current position.\n     * @returns { Promise<number> } Promise used to return the data read.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900044 - Network is unreachable\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    read(buffer: ArrayBuffer, options?: ReadOptions): Promise<number>;\n    /**\n     * Reads data from this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Reads data from this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    read(buffer: ArrayBuffer, callback: AsyncCallback<number>): void;\n    /**\n     * Read stream.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { object } [options] - options.\n     * @param { AsyncCallback<number> } callback - The callback is used to return the number of file bytes read to buffer.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Reads data from this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data. This parameter is optional. By default,\n     * <br>data is read from the current position.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Reads data from this stream. This API uses an asynchronous callback to return the result.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data. This parameter is optional. By default,\n     * <br>data is read from the current position.\n     * @param { AsyncCallback<number> } callback - Callback used to return the result.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    read(buffer: ArrayBuffer, options: ReadOptions, callback: AsyncCallback<number>): void;\n    /**\n     * Read stream with sync interface.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { object } [options] - options.\n     * @returns { number } Returns the number of file bytes read to file.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 9\n     */\n    /**\n     * Read stream with sync interface.\n     *\n     * @param { ArrayBuffer } buffer - buffer.\n     * @param { ReadOptions } [options] - options.\n     * @returns { number } Returns the number of file bytes read to file.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    /**\n     * Reads data from this stream. This API returns the result synchronously.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data. This parameter is optional. By default,\n     * <br>data is read from the current position.\n     * @returns { number } Length of the data read.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900044 - Network is unreachable\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    /**\n     * Reads data from this stream. This API returns the result synchronously.\n     *\n     * @param { ArrayBuffer } buffer - Buffer used to store the file read.\n     * @param { ReadOptions } [options] - The options are as follows:\n     * <br>length (number): length of the data to read. This parameter is optional. The default value is the buffer length.\n     * <br>offset (number): start position to read the data. This parameter is optional. By default,\n     * <br>data is read from the current position.\n     * @returns { number } Length of the data read.\n     * @throws { BusinessError } 13900004 - Interrupted system call\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900010 - Try again\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900019 - Is a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900034 - Operation would block\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @throws { BusinessError } 13900044 - Network is unreachable\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 20\n     */\n    readSync(buffer: ArrayBuffer, options?: ReadOptions): number;\n}\n/**\n * Provides APIs for observing events.\n *\n * @interface WatchEventListener\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\nexport interface WatchEventListener {\n    /**\n     * Specifies the callback function to be invoked.\n     *\n     * @param { WatchEvent } event - Event for the callback to invoke.\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    (event: WatchEvent): void;\n}\n/**\n * Defines the event to observe.\n *\n * @interface WatchEvent\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\nexport interface WatchEvent {\n    /**\n     * Sandbox path of the file to observe. The sandbox path contains the file name.\n     *\n     * @type { string }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly fileName: string;\n    /**\n     * Events to observe. Multiple events can be separated by a bitwise OR operator (|).\n     * 0x1: IN_ACCESS: A file is accessed.\n     * 0x2: IN_MODIFY: The file content is modified.\n     * 0x4: IN_ATTRIB: The file metadata is modified.\n     * 0x8: IN_CLOSE_WRITE: A file is opened, written with data, and then closed.\n     * 0x10: IN_CLOSE_NOWRITE: A file or directory is opened and then closed without data written.\n     * 0x20: IN_OPEN: A file or directory is opened.\n     * 0x40: IN_MOVED_FROM: A file in the observed directory is moved.\n     * 0x80: IN_MOVED_TO: A file is moved to the observed directory.\n     * 0x100: IN_CREATE: A file or directory is created in the observed directory.\n     * 0x200: IN_DELETE: A file or directory is deleted from the observed directory.\n     * 0x400: IN_DELETE_SELF: The observed directory is deleted. After the directory is deleted, the listening stops.\n     * 0x800: IN_MOVE_SELF: The observed file or directory is moved. After the file or directory is moved, the listening continues.\n     * 0xfff: IN_ALL_EVENTS: All events.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly event: number;\n    /**\n     * Cookie bound with the event. Currently, only the IN_MOVED_FROM and IN_MOVED_TO events are supported.\n     * The IN_MOVED_FROM and IN_MOVED_TO events of the same file have the same cookie value.\n     *\n     * @type { number }\n     * @readonly\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    readonly cookie: number;\n}\n/**\n * Provides APIs for observing the changes of files or directories.\n * Before using the APIs of Watcher, call createWatcher() to create a Watcher object.\n *\n * @interface Watcher\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\nexport interface Watcher {\n    /**\n     * Starts listening.\n     *\n     * @throws { BusinessError } 13900002 - No such file or directory\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900011 - Out of memory\n     * @throws { BusinessError } 13900012 - Permission denied\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900015 - File exists\n     * @throws { BusinessError } 13900018 - Not a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900021 - File table overflow\n     * @throws { BusinessError } 13900022 - Too many open files\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900030 - File name too long\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    start(): void;\n    /**\n     * Stops listening and removes the Watcher object.\n     *\n     * @throws { BusinessError } 13900002 - No such file or directory\n     * @throws { BusinessError } 13900008 - Bad file descriptor\n     * @throws { BusinessError } 13900011 - Out of memory\n     * @throws { BusinessError } 13900012 - Permission denied\n     * @throws { BusinessError } 13900013 - Bad address\n     * @throws { BusinessError } 13900015 - File exists\n     * @throws { BusinessError } 13900018 - Not a directory\n     * @throws { BusinessError } 13900020 - Invalid argument\n     * @throws { BusinessError } 13900021 - File table overflow\n     * @throws { BusinessError } 13900022 - Too many open files\n     * @throws { BusinessError } 13900025 - No space left on device\n     * @throws { BusinessError } 13900030 - File name too long\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    stop(): void;\n}\n/**\n * Represents the information obtained by the ReaderIterator object.\n *\n * @interface ReaderIteratorResult\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\nexport interface ReaderIteratorResult {\n    /**\n     * Whether the iteration is complete.\n     * The value true means the iteration is complete; the value false means the iteration is not complete.\n     *\n     * @type { boolean }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    done: boolean;\n    /**\n     * File text content read line by line.\n     *\n     * @type { string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    value: string;\n}\n/**\n * Provides a ReaderIterator object. Before calling APIs of ReaderIterator,\n * you need to use readLines() to create a ReaderIterator instance.\n *\n * @interface ReaderIterator\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare interface ReaderIterator {\n    /**\n     * Obtains the ReaderIterator result.\n     *\n     * @returns { ReaderIteratorResult } ReaderIteratorResult object obtained.\n     * @throws { BusinessError } 13900005 - I/O error\n     * @throws { BusinessError } 13900037 - No data available\n     * @throws { BusinessError } 13900042 - Unknown error\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    next(): ReaderIteratorResult;\n}\n/**\n * File filter type\n *\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @since 10\n */\n/**\n * Defines the file filtering configuration used by listFile().\n *\n * @interface Filter\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @crossplatform\n * @atomicservice\n * @since 11\n */\nexport interface Filter {\n    /**\n     * The suffix of the file.\n     *\n     * @type { ?Array<string> }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Locate files that fully match the specified file name extensions, which are of the OR relationship.\n     *\n     * @type { ?Array<string> }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    suffix?: Array<string>;\n    /**\n     * The display name of the file.\n     *\n     * @type { ?Array<string> }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Locate files that fuzzy match the specified file names, which are of the OR relationship.\n     * Currently, only the wildcard * is supported.\n     *\n     * @type { ?Array<string> }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    displayName?: Array<string>;\n    /**\n     * The mimetype of the file.\n     *\n     * @type { ?Array<string> }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Locate files that fully match the specified MIME types, which are of the OR relationship.\n     *\n     * @type { ?Array<string> }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    mimeType?: Array<string>;\n    /**\n     * The exceeding size of the file.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Locate files that are greater than or equal to the specified size.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    fileSizeOver?: number;\n    /**\n     * The last modification time of the file.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Locate files whose last modification time is the same or later than the specified time.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    lastModifiedAfter?: number;\n    /**\n     * Whether to exclude media files.\n     *\n     * @type { ?boolean }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * Whether to exclude the files already in Media. The value true means to exclude the files already in Media;\n     * the value false means not to exclude the files already in Media.\n     *\n     * @type { ?boolean }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @crossplatform\n     * @atomicservice\n     * @since 11\n     */\n    excludeMedia?: boolean;\n}\n/**\n * Conflict Files type\n *\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 10\n */\n/**\n * Defines conflicting file information used in copyDir() or moveDir().\n *\n * @interface ConflictFiles\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\nexport interface ConflictFiles {\n    /**\n     * The path of the source file.\n     *\n     * @type { string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * The path of the source file.\n     *\n     * @type { string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    srcFile: string;\n    /**\n     * The path of the source file.\n     *\n     * @type { string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 10\n     */\n    /**\n     * The path of the destination file.\n     *\n     * @type { string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    destFile: string;\n}\n/**\n * Defines the options used in readLines().\n *\n * @interface Options\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\nexport interface Options {\n    /**\n     * File encoding format. It is optional.\n     *\n     * @type { ?string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    encoding?: string;\n}\n/**\n * Defines the options used in read().\n *\n * @interface ReadOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\nexport interface ReadOptions {\n    /**\n     * Length of the data to read, in bytes. This parameter is optional. The default value is the buffer length.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    offset?: number;\n    /**\n     * Start position of the file to read (current filePointer plus offset), in bytes. This parameter is optional.\n     * By default, data is read from the filePointer.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    length?: number;\n}\n/**\n * Defines the options used in readText(). It inherits from ReadOptions.\n *\n * @extends ReadOptions\n * @interface ReadTextOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\nexport interface ReadTextOptions extends ReadOptions {\n    /**\n     * Format of the data to be encoded. This parameter is valid only when the data type is string.\n     * The default value is 'utf-8', which is the only value supported.\n     *\n     * @type { ?string }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    encoding?: string;\n}\n/**\n * Defines the options use din write(). It inherits from Options.\n *\n * @extends Options\n * @interface WriteOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\nexport interface WriteOptions extends Options {\n    /**\n     * Option for creating the writeable stream. You must specify one of the following options.\n     * OpenMode.READ_ONLY(0o0): read-only, which is the default value.\n     * OpenMode.WRITE_ONLY(0o1): write-only.\n     * OpenMode.READ_WRITE(0o2): read/write.\n     * You can also specify the following options, separated by a bitwise OR operator (|).\n     * By default, no additional options are given.\n     * OpenMode.CREATE(0o100): If the file does not exist, create it.\n     * OpenMode.TRUNC(0o1000): If the file exists and is opened in write mode, truncate the file length to 0.\n     * OpenMode.APPEND(0o2000): Open the file in append mode. New data will be added to the end of the file.\n     * OpenMode.NONBLOCK(0o4000): If path points to a named pipe (also known as a FIFO), block special file,\n     * or character special file, perform non-blocking operations on the opened file and in subsequent I/Os.\n     * OpenMode.DIR(0o200000): If path does not point to a directory, throw an exception. The write permission is not allowed.\n     * OpenMode.NOFOLLOW(0o400000): If path points to a symbolic link, throw an exception.\n     * OpenMode.SYNC(0o4010000): Open the file in synchronous I/O mode.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    offset?: number;\n    /**\n     * Length of the data to write, in bytes. This parameter is optional. The default value is the buffer length.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    length?: number;\n}\n/**\n * ListFileOptions type\n *\n * @interface ListFileOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 11\n */\nexport interface ListFileOptions {\n    /**\n     * Whether to list all files in the subdirectories recursively. This parameter is optional.\n     * The default value is false. If recursion is false, the names of files and directories that meet the filtering\n     * requirements in the current directory are returned. If recursion is true, relative paths (starting with /)\n     * of all files that meet the specified conditions in the current directory are returned.\n     *\n     * @type { ?boolean }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    recursion?: boolean;\n    /**\n     * Number of file names to list. This parameter is optional. The default value is 0, which means to list all files.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    listNum?: number;\n    /**\n     * File filtering configuration. This parameter is optional. It specifies the file filtering conditions.\n     *\n     * @type { ?Filter }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 11\n     */\n    filter?: Filter;\n}\n/**\n * Defines the options used in createRandomAccessFile().\n *\n * @interface RandomAccessFileOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\nexport interface RandomAccessFileOptions {\n    /**\n     * Start position to read the data, in bytes. This parameter is optional. By default, data is read from the current position.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    start?: number;\n    /**\n     * End position to read the data, in bytes. This parameter is optional. The default value is the end of the file.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    end?: number;\n}\n/**\n * Defines the options used in createReadStream().\n *\n * @interface ReadStreamOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\nexport interface ReadStreamOptions {\n    /**\n     * Start position to read the data, in bytes. This parameter is optional. By default,\n     * data is read from the current position.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    start?: number;\n    /**\n     * End position to read the data, in bytes. This parameter is optional.\n     * The default value is the end of the file.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    end?: number;\n}\n/**\n * Defines the options used in createWriteStream().\n *\n * @interface WriteStreamOptions\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\nexport interface WriteStreamOptions {\n    /**\n     * Option for creating the writeable stream.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    mode?: number;\n    /**\n     * Start position to write the data, in bytes. This parameter is optional.\n     * By default, data is written from the beginning of the file.\n     *\n     * @type { ?number }\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    start?: number;\n}\n/**\n * The listeners of Distributed File System.\n *\n * @typedef DfsListeners\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\nexport interface DfsListeners {\n    /**\n     * The Listener of Distributed File System status\n     *\n     * @param { string } networkId - The networkId of device.\n     * @param { number } status - The status code of Distributed File System.\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    onStatus(networkId: string, status: number): void;\n}\n/**\n * Enumerates the types of the relative offset position used in lseek().\n *\n * @enum { number } whence type\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare enum WhenceType {\n    /**\n     * Starting position of the file offset.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    SEEK_SET = 0,\n    /**\n     * Current position of the file offset.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    SEEK_CUR = 1,\n    /**\n     * Ending position of the file offset.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    SEEK_END = 2\n}\n/**\n * Enumeration of different types of file location.\n *\n * @enum { number } location type\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 11\n */\ndeclare enum LocationType {\n    /**\n     * The file is stored in a local device.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    LOCAL = 1 << 0,\n    /**\n     * The file is stored in the cloud.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 11\n     */\n    CLOUD = 1 << 1\n}\n/**\n * Enumerates the access modes to verify. If this parameter is left blank, the system checks whether the file exists.\n *\n * @enum { number } access mode type\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @atomicservice\n * @since 12\n */\ndeclare enum AccessModeType {\n    /**\n     * Whether the file exists.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 12\n     */\n    EXIST = 0,\n    /**\n     * Verify the write permission on the file.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 12\n     */\n    WRITE = 2,\n    /**\n     * Verify the read permission on the file.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 12\n     */\n    READ = 4,\n    /**\n     * Verify the read/write permission on the file.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @atomicservice\n     * @since 12\n     */\n    READ_WRITE = 6\n}\n/**\n * Enumerates the locations of the file to verify.\n *\n * @enum { number } access flag type\n * @syscap SystemCapability.FileManagement.File.FileIO\n * @since 12\n */\ndeclare enum AccessFlagType {\n    /**\n     * The file is stored locally.\n     *\n     * @syscap SystemCapability.FileManagement.File.FileIO\n     * @since 12\n     */\n    LOCAL = 0\n}\n",
}
export default FILE;